﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<title>【添加收货地址】</title>
	<script type="text/javascript" src="../customer/js/jsAddress.js"></script>
	<script>
		function checkname(){
			var submitButton=document.getElementById("submit");
			var element1 = document.getElementById("user-name").value;
			var element2 = document.getElementById("phone").value;			
			var element3 = document.getElementById("intro").value;
			var checknameinfo = $("#checknameinfo");
			checknameinfo.html("");
			if ("" == element1) {
				checknameinfo.html("姓名不能为空");
				submitButton.disabled = true;
			}else if(element2!="" && element3!=""){
				submitButton.disabled = false;	
			}
		}
		function checkphone(){
			var submitButton=document.getElementById("submit");
			var element1 = document.getElementById("user-name").value;
			var element2 = document.getElementById("phone").value;			
			var element3 = document.getElementById("intro").value;
			var checkphoneinfo = $("#checkphoneinfo");
			checkphoneinfo.html("");
			if ("" == element2) {
				checkphoneinfo.html("手机号码不能为空");
				submitButton.disabled = true;
			}else if(element1!="" && element3!=""){
				submitButton.disabled = false;	
			}
			
		}
		function checkintro(){
			var submitButton=document.getElementById("submit");
			var element1 = document.getElementById("user-name").value;
			var element2 = document.getElementById("phone").value;			
			var element3 = document.getElementById("intro").value;
			var checkintroinfo = $("#checkintroinfo");
			checkintroinfo.html("");
			if ("" == element3) {
				checkintroinfo.html("详细地址不能为空");
				submitButton.disabled = true;
			}else if(element1!="" && element3!=""){
				submitButton.disabled = false;	
			}
		}
	</script>
</head>
<body>
	<jsp:include page="main_top.jsp"></jsp:include>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;添加新地址>>
	<center>
	<br><br><br><br><br>
		<table border="1" cellpadding="50">

			<s:form action="addConsigneeAction">
				<tr></tr>
				<tr>
					<td>收&nbsp;&nbsp;货&nbsp;&nbsp;人：</td>
					<td>
						<input type="text" id="user-name" name="consignee.consigneeName" placeholder="收货人"
						onPropertyChange="checkname()" oninput="checkname()" onfocus="checkname()"/>
						<font color="red">*<span id="checknameinfo"></span></font>
					</td>
				</tr>
				<tr></tr>
				<tr>
					<td>手机号码：</td>
					<td>
						<input id="phone" placeholder="手机号必填" name="consignee.mobilePhone" 
						onPropertyChange="checkphone()" oninput="checkphone()"  onfocus="checkphone()">
						<font color="red">*<span id="checkphoneinfo"></span></font>
					</td>

				</tr>
				<tr>
					<td>所&nbsp;&nbsp;在&nbsp;&nbsp;地：</td>
					<td>
						省：<select id="cmbProvince" name="consignee.province"onchange="changeValue()"></select>&nbsp;&nbsp;
						市：<select id="cmbCity" name="consignee.city"></select>&nbsp;&nbsp;
						区：<select id="cmbArea" name="consignee.area"></select>
						<script type="text/javascript">
							addressInit('cmbProvince', 'cmbCity', 'cmbArea', '广东', '珠海市', '香洲区');
						</script>		
					</td>
				</tr>
				<tr></tr>
				<tr>
					<td>详细地址：</td>
					<td>
						<input  id="intro" placeholder="输入详细地址" name="consignee.detailAddress"
						onPropertyChange="checkintro()" oninput="checkintro()"  onfocus="checkintro()">
						</input>
						<font color="red">*<span id="checkintroinfo"></span></font><br>
					</td>
				</tr>
				<tr>
					<td></td>
					<td><input type="submit" id="submit" value="保存" disabled="disabled">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="取消"></imput></td>
				</tr>
				
				
			</s:form>
		</table>
		<br><br>
	</center>
	<br><br><br><br><br>
	<jsp:include page="main_foot.jsp"></jsp:include>
</body>
</html>